package com.lq.utils;

public class UniqueNumberUtil {

    /**
     * 设备唯一标识
     *
     * @param deviceHostID
     * @return
     */
    public static String getNumber(String deviceHostID) {
        String uniqueNumber = "";
        if (deviceHostID != null && !"".equals(deviceHostID)) {
            if (deviceHostID.length() == 15) {
                uniqueNumber = deviceHostID.substring(0, 3);
            } else if (deviceHostID.length() == 12) {
                String jq = deviceHostID.substring(4, 8);
                uniqueNumber = Integer.parseInt(jq, 16) + "";
            }
        }
        return uniqueNumber;
    }

    public static void main(String[] args) {
        System.err.println(getNumber("211202590010"));
    }
}
